﻿Imports ISNet.WebUI.WebTreeView
Imports log4net

Partial Class R03
    Inherits System.Web.UI.Page

    Public ScriptText As String = ""
    Private Shared logger As ILog = LogManager.GetLogger("R03")

    Protected Sub Page_Load(sender As Object, e As EventArgs) Handles Me.Load
        Label1.Text = "ระบบจัดทำงบประมาณ >> รายงาน >> กลุ่มประเภทหน่วยงาน"
        If Session("users") Is Nothing Then
            Response.Redirect("LoginForm.aspx")
        End If
        
        If IsPostBack = False Then
            Try
                Dim adap As New DBdataTableAdapters.AppConfigsTableAdapter
                Dim dt As New DBdata.AppConfigsDataTable
                dt = adap.GetData
                For Each item As DBdata.AppConfigsRow In dt
                    Select Case item.Name
                        Case "ACTIVE_PLAN_YEAR"
                            PlanYearsTxt.Text = item.Value
                    End Select
                Next
            Catch ex As Exception
                logger.Error(ex.Message)
                logger.Error(ex.StackTrace)
            End Try
        End If


    End Sub




    Protected Sub toReport_Click(sender As Object, e As ImageClickEventArgs) Handles toReport.Click
        If Val(PlanYearsTxt.Text) = 0 Then
            ScriptText = "<script language='javascript'>alert('กรุณาระบุปีงบประมาณ');</script>"
            Exit Sub
        End If

        Session.Remove("year")
        Session.Add("year", PlanYearsTxt.Text)

        ScriptText = "<script language='javascript'>openpop();</script>"


    End Sub
End Class
